//
//  MemWithOUTTableViewCell.m
//  shanHaiHuiApp
//
//  Created by 小和尚 on 2018/3/21.
//  Copyright © 2018年 徐双. All rights reserved.
//

#import "MemWithOUTTableViewCell.h"

@implementation MemWithOUTTableViewCell

#pragma mark -- Action

- (void)configBtnClick{
    
    if (_getCongfigClick) {
        _getCongfigClick();
    }
    
}

#pragma mark -- INIT

- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        _dispatchLabel = [[UILabel alloc] init];
        _dispatchLabel.text = @"配送类型：会员配送";
        _dispatchLabel.font = DEF_FontSize_14;
        _dispatchLabel.textColor = getColor(@"323232");
        
        _lineViewOne = [[UIView alloc] init];
        _lineViewOne.backgroundColor = getColor(dividerColor);
        
        _personLabel = [[UILabel alloc] init];
        _personLabel.text = @"收货人：尼古拉斯李强";
        _personLabel.font = DEF_FontSize_14;
        _personLabel.textColor = getColor(@"323232");
        
        _phoneLabel = [[UILabel alloc] init];
        _phoneLabel.textColor = getColor(@"323232");
        _phoneLabel.font = DEF_FontSize_14;
        _phoneLabel.text = @"19000000000";
        
        _adressLabel = [[UILabel alloc] init];
        _adressLabel.textColor = getColor(@"8D8D8D");
        _adressLabel.font = DEF_FontSize_11;
        _adressLabel.text = @"辽宁省沈阳市和平区哈尔滨路17号辽宁山海慧大药房3 楼电商部";
        _adressLabel.numberOfLines = 0;
        
        _lineViewTwo = [[UIView alloc] init];
        _lineViewTwo.backgroundColor = getColor(dividerColor);
        
       
        
        _configBtn = [[UIButton alloc] init];
        [_configBtn setTitle:@"确认配送" forState:UIControlStateNormal];
        [_configBtn setTitleColor:getColor(@"4E4E4E") forState:UIControlStateNormal];
        _configBtn.layer.borderColor = getColor(@"4E4E4E").CGColor;
        _configBtn.layer.borderWidth = 1.0f;
        _configBtn.layer.cornerRadius = 5.0f;
        _configBtn.layer.masksToBounds = YES;
        _configBtn.titleLabel.font = DEF_FontSize_12;
        [_configBtn addTarget:self action:@selector(configBtnClick) forControlEvents:UIControlEventTouchUpInside];
        
        _lineViewFour = [[UIView alloc] init];
        _lineViewFour.backgroundColor = getColor(dividerColor);
        
        _configLabel = [[UILabel alloc]init];
        _configLabel.textColor = getColor(@"323232");
        _configLabel.font = DEF_FontSize_14;
        _configLabel.text = @"配送人员: 王晓明";
        _configLabel.hidden = YES;
        
        _timeLabel = [[UILabel alloc] init];
        _timeLabel.textColor = getColor(@"323232");
        _timeLabel.font = DEF_FontSize_14;
        _timeLabel.text = @"配送时间: 2018.01.01";
        _timeLabel.hidden = YES;
        
        
        [self sd_addSubviews:@[self.dispatchLabel,self.lineViewOne,self.personLabel,self.phoneLabel,self.adressLabel,self.lineViewTwo,self.configBtn,self.lineViewFour,self.configLabel,self.timeLabel]];
        
        ws(self)
        
        [self.dispatchLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(UNIT_WIDTH(15));
            make.top.mas_equalTo(UNIT_HEIGHT(15));
            make.height.mas_equalTo(UNIT_HEIGHT(30));
        }];
        
        [self.lineViewOne mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(weakself.dispatchLabel.mas_bottom).offset(UNIT_HEIGHT(15));
            make.left.mas_equalTo(0);
            make.right.mas_equalTo(0);
            make.height.mas_equalTo(0.5);
        }];
        
        [self.personLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(UNIT_WIDTH(15));
            make.top.mas_equalTo(weakself.lineViewOne.mas_bottom).offset(10);
            make.height.mas_equalTo(UNIT_HEIGHT(30));
        }];
        
        [self.phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(UNIT_WIDTH(-15));
            make.top.mas_equalTo(weakself.lineViewOne.mas_bottom).offset(15);
            make.height.mas_equalTo(UNIT_HEIGHT(30));
        }];
        [self.adressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(weakself.personLabel.mas_bottom).offset(UNIT_HEIGHT(10));
            make.left.mas_equalTo(UNIT_WIDTH(80));
            make.right.mas_equalTo(UNIT_WIDTH(-15));
        }];
        
        [self.lineViewTwo mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(weakself.adressLabel.mas_bottom).offset(UNIT_HEIGHT(10));
            make.left.mas_equalTo(0);
            make.right.mas_equalTo(0);
            make.height.mas_equalTo(0.5);
        }];
        
        
        [self.configBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(weakself.lineViewTwo.mas_bottom).offset(UNIT_HEIGHT(10));
            make.right.mas_equalTo(UNIT_WIDTH(-16));
            make.height.mas_equalTo(UNIT_HEIGHT(30));
            make.width.mas_equalTo(UNIT_WIDTH(80));
        }];
        
        [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.left.mas_equalTo(UNIT_WIDTH(15));
            make.top.mas_equalTo(weakself.lineViewTwo.mas_bottom).offset(UNIT_HEIGHT(10));
            make.height.mas_equalTo(UNIT_HEIGHT(30));
            
        }];
        
        [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(UNIT_WIDTH(-15));
            make.top.mas_equalTo(weakself.lineViewTwo.mas_bottom).offset(UNIT_HEIGHT(10));
            make.height.mas_equalTo(UNIT_HEIGHT(30));
            
        }];
        
        
        
        [self.lineViewFour mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(weakself.configBtn.mas_bottom).offset(UNIT_HEIGHT(10));
            make.left.mas_equalTo(0);
            make.right.mas_equalTo(0);
            make.height.mas_equalTo(UNIT_HEIGHT(5));
        }];
        
    }
    return self;
}

@end
